<?php
namespace application\datatypes;
use application\datatypes\DataType;
use application\utilities\Utility;
use application\system\Permalink;
class Level extends DataType {
	public static $name = 'Level';
	public static $fields = array(array('columnType'=>'INT(1)'));
	
	public static function validate($field, $data, $results) {
		$value = $data[$field->cf_column];
		
		$results['db_fields'][$field->cf_column] = $value;	
		
		return $results;
	}
	
	public static function display($formElements) {
		if($formElements) {
			echo $formElements['elements']['element'];
		}
	}
	
	public static function build($field, $data) {
		return FALSE;
	
	}
	
	public static function editForm($field) {
		?>
		<div class="box-content">
			You can't edit an automatic field.
		</div>
			<?php
	}
	
	public static function prepareData($field, $data) {
		return $data[$field->cf_column];
	}
	
}
?>